/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package folderManager;

import java.io.File;

/**
 *
 * @author Allan
 */
public abstract class FolderHandler
{
    /**
     * 
     * @author Allan Andersen
     * @param String[] folders
     * @return String tilbage
     */
    public static String checkForFolder(String[] folders)
    {
        String tilbage;
        tilbage = "";
        
        String rootPath;
        rootPath = System.getProperty("user.home") + File.separatorChar + "Dokumenter";

        String folderPath;
        folderPath = rootPath;
        
        for(int i = 0; i < folders.length; i++)
        {
            folderPath = folderPath + "\\" +  folders[i];
            
            File folderExisting = new File(folderPath);
            if(folderExisting.exists())
            {
                tilbage = "";
            }
            else
            {
                i = folders.length;
                tilbage = folderPath;
            }
        }
        
        return tilbage;
    }
}
